<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function Person(name,age,gender,height){
            this.name = name ; 
            this.age = age ; 
            this.gender = gender ;
            this.height = height ; 
        }
        Person.prototype.fn = function (){
            console.log(this);
        }
        Person.prototype.height = "175cm" ;
        Person.prototype.weight = "50kg" ;
        // Object.getPrototypeOf(zhangsan).height = "175cm" ; 
        let zhangsan = new Person("张三",25,"男","178cm");
        Object.setPrototypeOf(Object.getPrototypeOf(zhangsan),{constructor:Person.prototype,fn2:function(){console.log(this)}});
        
        Object.getPrototypeOf(zhangsan).fn2(); 

        zhangsan.fn2();

        // console.log(zhangsan);
    </script>
</body>
</html>